#ifndef LOGINWIDGET_H
#define LOGINWIDGET_H

#include <QWidget>
#include <QGridLayout>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>

class LoginWidget : public QWidget
{
    Q_OBJECT
public:
    explicit LoginWidget(QWidget *parent = nullptr);

    void setIsLogin(bool isLogin)
    {
        _isLoginMode = isLogin;
        if (_isLoginMode)
        {
            this->setWindowTitle("登录");
            _titleLabel->setText("登录");
            _submitBtn->setText("登录");
            _mailModBtn->setText("邮箱登录");
            _switchModBtn->setText("注册");
        }
        else
        {
            this->setWindowTitle("注册");
            _titleLabel->setText("注册");
            _submitBtn->setText("注册");
            _mailModBtn->setText("邮箱注册");
            _switchModBtn->setText("登录");
        }
    }
private:
    QGridLayout *_layout;
    QLabel *_titleLabel;
    QLineEdit *_usernameEdit;
    QLineEdit *_passwordEdit;
    QLineEdit *_verifyCodeEdit;
    QPushButton *_verifyCodeWidget;
    QPushButton *_submitBtn;
    QPushButton *_mailModBtn;
    QPushButton *_switchModBtn;

    bool _isLoginMode = true;
signals:
};

#endif // LOGINWIDGET_H
